package com.logis.ryanrqwork;


import android.content.Context;

import com.logis.ryanrqwork.dao.DaoMaster;
import com.logis.ryanrqwork.dao.DaoSession;
import com.logis.ryanrqwork.dao.WinesShap;
import com.logis.ryanrqwork.dao.WinesShapDao;

import java.util.List;

public class DBController {
    private static DBController instance;
    private DaoMaster.DevOpenHelper helper;
    private DaoMaster daoMaster;
    private DaoSession daoSession;
    private DBController(Context context){
        helper = new DaoMaster.DevOpenHelper(context, "ryan.db", null);
        daoMaster = new DaoMaster(helper.getWritableDatabase());
        daoSession = daoMaster.newSession();
    }

    public static DBController getInstance(Context context){
        if(instance==null)
            instance=new DBController(context);

        return instance;
    }
    public DaoSession getDaoSession(){
        return daoSession;
    }

}
